import Const from "./Const";
import SceneManager from "../../LTGame/3d/SceneManager";

export default class GlobalUnit {
    // 3d场景
    static s3d: Laya.Scene3D;
    static camera: Laya.Camera;
    static light: Laya.DirectionLight;

    static InitAll() {
        if (Const.support3D) {
            this.s3d = Laya.stage.addChildAt(new Laya.Scene3D(), 0) as Laya.Scene3D;
            this.camera = new Laya.Camera();
            this.s3d.addChild(this.camera);
            SceneManager.instance.initCamera(this.camera);
            this.light = new Laya.DirectionLight;
            this.s3d.addChild(this.light);
            SceneManager.instance.initLight(this.light);
        }
    }
}